package leetCode.offer53_ii;

public class Solution1 implements Solution{

    @Override
    public int missingNumber(int[] nums) {
        int[] help = new int[nums.length+1];

        for (int num : nums) {
            if (num < nums.length + 1) {
                help[num] = 1;
            }
        }
        for(int i=0;i<help.length;i++){
            if(help[i]==0){
                return i;
            }
        }
        return 0;
    }
}
